package Thread.Thread_Security;

public class Demo26 {
    public static void main(String[] args) throws InterruptedException {
        Object obj=new Object();
        System.out.println("wait之前");
        //IllegalMonitorStateException非法的锁状态异常
        synchronized (obj){
            obj.wait();
        }
        //wait既然要释放锁，就必然要先加上锁
        System.out.println("wait之后");
    }
}
